Optimal. Leaf size=216 \[ \frac {2 \left (2 A b^2-3 a b B+a^2 (A+3 C)\right ) \sqrt {\frac {b+a \cos (c+d x)}{a+b}} F\left (\frac {1}{2} (c+d x)|\frac {2 a}{a+b}\right ) \sqrt {\sec (c+d x)}}{3 a^2 d \sqrt {a+b \sec (c+d x)}}-\frac {2 (2 A b-3 a B) E\left (\frac {1}{2} (c+d x)|\frac {2 a}{a+b}\right ) \sqrt {a+b \sec (c+d x)}}{3 a^2 d \sqrt {\frac {b+a \cos (c+d x)}{a+b}} \sqrt {\sec (c+d x)}}+\frac {2 A \sqrt {a+b \sec (c+d x)} \sin (c+d x)}{3 a d \sqrt {\sec (c+d x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.35, antiderivative size = 216, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 8, integrand size = 45, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.178, Rules used = {4189, 4120,
3941, 2734, 2732, 3943, 2742, 2740} \begin {gather*} \frac {2 \sqrt {\sec (c+d x)} \left (a^2 (A+3 C)-3 a b B+2 A b^2\right ) \sqrt {\frac {a \cos (c+d x)+b}{a+b}} F\left (\frac {1}{2} (c+d x)|\frac {2 a}{a+b}\right )}{3 a^2 d \sqrt {a+b \sec (c+d x)}}-\frac {2 (2 A b-3 a B) \sqrt {a+b \sec (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 a}{a+b}\right )}{3 a^2 d \sqrt {\sec (c+d x)} \sqrt {\frac {a \cos (c+d x)+b}{a+b}}}+\frac {2 A \sin (c+d x) \sqrt {a+b \sec (c+d x)}}{3 a d \sqrt {\sec (c+d x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2732
Rule 2734
Rule 2740
Rule 2742
Rule 3941
Rule 3943
Rule 4120
Rule 4189
Rubi steps
\begin {align*} \int \frac {A+B \sec (c+d x)+C \sec ^2(c+d x)}{\sec ^{\frac {3}{2}}(c+d x) \sqrt {a+b \sec (c+d x)}} \, dx &=\frac {2 A \sqrt {a+b \sec (c+d x)} \sin (c+d x)}{3 a d \sqrt {\sec (c+d x)}}-\frac {2 \int \frac {\frac {1}{2} (2 A b-3 a B)-\frac {1}{2} a (A+3 C) \sec (c+d x)}{\sqrt {\sec (c+d x)} \sqrt {a+b \sec (c+d x)}} \, dx}{3 a}\\ &=\frac {2 A \sqrt {a+b \sec (c+d x)} \sin (c+d x)}{3 a d \sqrt {\sec (c+d x)}}-\frac {(2 A b-3 a B) \int \frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {\sec (c+d x)}} \, dx}{3 a^2}+\frac {1}{3} \left (A+\frac {b (2 A b-3 a B)}{a^2}+3 C\right ) \int \frac {\sqrt {\sec (c+d x)}}{\sqrt {a+b \sec (c+d x)}} \, dx\\ &=\frac {2 A \sqrt {a+b \sec (c+d x)} \sin (c+d x)}{3 a d \sqrt {\sec (c+d x)}}+\frac {\left (\left (A+\frac {b (2 A b-3 a B)}{a^2}+3 C\right ) \sqrt {b+a \cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \frac {1}{\sqrt {b+a \cos (c+d x)}} \, dx}{3 \sqrt {a+b \sec (c+d x)}}-\frac {\left ((2 A b-3 a B) \sqrt {a+b \sec (c+d x)}\right ) \int \sqrt {b+a \cos (c+d x)} \, dx}{3 a^2 \sqrt {b+a \cos (c+d x)} \sqrt {\sec (c+d x)}}\\ &=\frac {2 A \sqrt {a+b \sec (c+d x)} \sin (c+d x)}{3 a d \sqrt {\sec (c+d x)}}+\frac {\left (\left (A+\frac {b (2 A b-3 a B)}{a^2}+3 C\right ) \sqrt {\frac {b+a \cos (c+d x)}{a+b}} \sqrt {\sec (c+d x)}\right ) \int \frac {1}{\sqrt {\frac {b}{a+b}+\frac {a \cos (c+d x)}{a+b}}} \, dx}{3 \sqrt {a+b \sec (c+d x)}}-\frac {\left ((2 A b-3 a B) \sqrt {a+b \sec (c+d x)}\right ) \int \sqrt {\frac {b}{a+b}+\frac {a \cos (c+d x)}{a+b}} \, dx}{3 a^2 \sqrt {\frac {b+a \cos (c+d x)}{a+b}} \sqrt {\sec (c+d x)}}\\ &=\frac {2 \left (A+\frac {b (2 A b-3 a B)}{a^2}+3 C\right ) \sqrt {\frac {b+a \cos (c+d x)}{a+b}} F\left (\frac {1}{2} (c+d x)|\frac {2 a}{a+b}\right ) \sqrt {\sec (c+d x)}}{3 d \sqrt {a+b \sec (c+d x)}}-\frac {2 (2 A b-3 a B) E\left (\frac {1}{2} (c+d x)|\frac {2 a}{a+b}\right ) \sqrt {a+b \sec (c+d x)}}{3 a^2 d \sqrt {\frac {b+a \cos (c+d x)}{a+b}} \sqrt {\sec (c+d x)}}+\frac {2 A \sqrt {a+b \sec (c+d x)} \sin (c+d x)}{3 a d \sqrt {\sec (c+d x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains higher order function than in optimal. Order 6 vs. order 4 in
optimal.
time = 6.60, size = 1959, normalized size = 9.07 \begin {gather*} \frac {(b+a \cos (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \left (-\frac {4 (-2 A b+3 a B) \cot (c)}{3 a^2 d}+\frac {4 A \cos (d x) \sin (c)}{3 a d}+\frac {4 A \cos (c) \sin (d x)}{3 a d}\right )}{(A+2 C+2 B \cos (c+d x)+A \cos (2 c+2 d x)) \sec ^{\frac {3}{2}}(c+d x) \sqrt {a+b \sec (c+d x)}}-\frac {4 A F_1\left (\frac {1}{2};\frac {1}{2},\frac {1}{2};\frac {3}{2};\frac {\csc (c) \left (b-a \sqrt {1+\cot ^2(c)} \sin (c) \sin (d x-\text {ArcTan}(\cot (c)))\right )}{a \sqrt {1+\cot ^2(c)} \left (1+\frac {b \csc (c)}{a \sqrt {1+\cot ^2(c)}}\right )},\frac {\csc (c) \left (b-a \sqrt {1+\cot ^2(c)} \sin (c) \sin (d x-\text {ArcTan}(\cot (c)))\right )}{a \sqrt {1+\cot ^2(c)} \left (-1+\frac {b \csc (c)}{a \sqrt {1+\cot ^2(c)}}\right )}\right ) \sqrt {b+a \cos (c+d x)} \csc (c) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \sec (d x-\text {ArcTan}(\cot (c))) \sqrt {\frac {a \sqrt {1+\cot ^2(c)}-a \sqrt {1+\cot ^2(c)} \sin (d x-\text {ArcTan}(\cot (c)))}{a \sqrt {1+\cot ^2(c)}-b \csc (c)}} \sqrt {\frac {a \sqrt {1+\cot ^2(c)}+a \sqrt {1+\cot ^2(c)} \sin (d x-\text {ArcTan}(\cot (c)))}{a \sqrt {1+\cot ^2(c)}+b \csc (c)}} \sqrt {b-a \sqrt {1+\cot ^2(c)} \sin (c) \sin (d x-\text {ArcTan}(\cot (c)))}}{3 a d (A+2 C+2 B \cos (c+d x)+A \cos (2 c+2 d x)) \sqrt {1+\cot ^2(c)} \sec ^{\frac {3}{2}}(c+d x) \sqrt {a+b \sec (c+d x)}}-\frac {4 C F_1\left (\frac {1}{2};\frac {1}{2},\frac {1}{2};\frac {3}{2};\frac {\csc (c) \left (b-a \sqrt {1+\cot ^2(c)} \sin (c) \sin (d x-\text {ArcTan}(\cot (c)))\right )}{a \sqrt {1+\cot ^2(c)} \left (1+\frac {b \csc (c)}{a \sqrt {1+\cot ^2(c)}}\right )},\frac {\csc (c) \left (b-a \sqrt {1+\cot ^2(c)} \sin (c) \sin (d x-\text {ArcTan}(\cot (c)))\right )}{a \sqrt {1+\cot ^2(c)} \left (-1+\frac {b \csc (c)}{a \sqrt {1+\cot ^2(c)}}\right )}\right ) \sqrt {b+a \cos (c+d x)} \csc (c) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \sec (d x-\text {ArcTan}(\cot (c))) \sqrt {\frac {a \sqrt {1+\cot ^2(c)}-a \sqrt {1+\cot ^2(c)} \sin (d x-\text {ArcTan}(\cot (c)))}{a \sqrt {1+\cot ^2(c)}-b \csc (c)}} \sqrt {\frac {a \sqrt {1+\cot ^2(c)}+a \sqrt {1+\cot ^2(c)} \sin (d x-\text {ArcTan}(\cot (c)))}{a \sqrt {1+\cot ^2(c)}+b \csc (c)}} \sqrt {b-a \sqrt {1+\cot ^2(c)} \sin (c) \sin (d x-\text {ArcTan}(\cot (c)))}}{a d (A+2 C+2 B \cos (c+d x)+A \cos (2 c+2 d x)) \sqrt {1+\cot ^2(c)} \sec ^{\frac {3}{2}}(c+d x) \sqrt {a+b \sec (c+d x)}}+\frac {4 A b \sqrt {b+a \cos (c+d x)} \csc (c) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \left (\frac {F_1\left (-\frac {1}{2};-\frac {1}{2},-\frac {1}{2};\frac {1}{2};-\frac {\sec (c) \left (b+a \cos (c) \cos (d x+\text {ArcTan}(\tan (c))) \sqrt {1+\tan ^2(c)}\right )}{a \sqrt {1+\tan ^2(c)} \left (1-\frac {b \sec (c)}{a \sqrt {1+\tan ^2(c)}}\right )},-\frac {\sec (c) \left (b+a \cos (c) \cos (d x+\text {ArcTan}(\tan (c))) \sqrt {1+\tan ^2(c)}\right )}{a \sqrt {1+\tan ^2(c)} \left (-1-\frac {b \sec (c)}{a \sqrt {1+\tan ^2(c)}}\right )}\right ) \sin (d x+\text {ArcTan}(\tan (c))) \tan (c)}{\sqrt {1+\tan ^2(c)} \sqrt {\frac {a \sqrt {1+\tan ^2(c)}-a \cos (d x+\text {ArcTan}(\tan (c))) \sqrt {1+\tan ^2(c)}}{b \sec (c)+a \sqrt {1+\tan ^2(c)}}} \sqrt {\frac {a \sqrt {1+\tan ^2(c)}+a \cos (d x+\text {ArcTan}(\tan (c))) \sqrt {1+\tan ^2(c)}}{-b \sec (c)+a \sqrt {1+\tan ^2(c)}}} \sqrt {b+a \cos (c) \cos (d x+\text {ArcTan}(\tan (c))) \sqrt {1+\tan ^2(c)}}}-\frac {\frac {\sin (d x+\text {ArcTan}(\tan (c))) \tan (c)}{\sqrt {1+\tan ^2(c)}}+\frac {2 a \cos (c) \left (b+a \cos (c) \cos (d x+\text {ArcTan}(\tan (c))) \sqrt {1+\tan ^2(c)}\right )}{a^2 \cos ^2(c)+a^2 \sin ^2(c)}}{\sqrt {b+a \cos (c) \cos (d x+\text {ArcTan}(\tan (c))) \sqrt {1+\tan ^2(c)}}}\right )}{3 a d (A+2 C+2 B \cos (c+d x)+A \cos (2 c+2 d x)) \sec ^{\frac {3}{2}}(c+d x) \sqrt {a+b \sec (c+d x)}}-\frac {2 B \sqrt {b+a \cos (c+d x)} \csc (c) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \left (\frac {F_1\left (-\frac {1}{2};-\frac {1}{2},-\frac {1}{2};\frac {1}{2};-\frac {\sec (c) \left (b+a \cos (c) \cos (d x+\text {ArcTan}(\tan (c))) \sqrt {1+\tan ^2(c)}\right )}{a \sqrt {1+\tan ^2(c)} \left (1-\frac {b \sec (c)}{a \sqrt {1+\tan ^2(c)}}\right )},-\frac {\sec (c) \left (b+a \cos (c) \cos (d x+\text {ArcTan}(\tan (c))) \sqrt {1+\tan ^2(c)}\right )}{a \sqrt {1+\tan ^2(c)} \left (-1-\frac {b \sec (c)}{a \sqrt {1+\tan ^2(c)}}\right )}\right ) \sin (d x+\text {ArcTan}(\tan (c))) \tan (c)}{\sqrt {1+\tan ^2(c)} \sqrt {\frac {a \sqrt {1+\tan ^2(c)}-a \cos (d x+\text {ArcTan}(\tan (c))) \sqrt {1+\tan ^2(c)}}{b \sec (c)+a \sqrt {1+\tan ^2(c)}}} \sqrt {\frac {a \sqrt {1+\tan ^2(c)}+a \cos (d x+\text {ArcTan}(\tan (c))) \sqrt {1+\tan ^2(c)}}{-b \sec (c)+a \sqrt {1+\tan ^2(c)}}} \sqrt {b+a \cos (c) \cos (d x+\text {ArcTan}(\tan (c))) \sqrt {1+\tan ^2(c)}}}-\frac {\frac {\sin (d x+\text {ArcTan}(\tan (c))) \tan (c)}{\sqrt {1+\tan ^2(c)}}+\frac {2 a \cos (c) \left (b+a \cos (c) \cos (d x+\text {ArcTan}(\tan (c))) \sqrt {1+\tan ^2(c)}\right )}{a^2 \cos ^2(c)+a^2 \sin ^2(c)}}{\sqrt {b+a \cos (c) \cos (d x+\text {ArcTan}(\tan (c))) \sqrt {1+\tan ^2(c)}}}\right )}{d (A+2 C+2 B \cos (c+d x)+A \cos (2 c+2 d x)) \sec ^{\frac {3}{2}}(c+d x) \sqrt {a+b \sec (c+d x)}} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(1930\) vs.
\(2(252)=504\).
time = 0.23, size = 1931, normalized size = 8.94
method | result | size |
default | \(\text {Expression too large to display}\) | \(1931\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [C] Result contains higher order function than in optimal. Order 9 vs. order
4.
time = 0.74, size = 460, normalized size = 2.13 \begin {gather*} \frac {6 \, A a^{2} \sqrt {\frac {a \cos \left (d x + c\right ) + b}{\cos \left (d x + c\right )}} \sqrt {\cos \left (d x + c\right )} \sin \left (d x + c\right ) + \sqrt {2} {\left (-3 i \, {\left (A + 3 \, C\right )} a^{2} + 6 i \, B a b - 4 i \, A b^{2}\right )} \sqrt {a} {\rm weierstrassPInverse}\left (-\frac {4 \, {\left (3 \, a^{2} - 4 \, b^{2}\right )}}{3 \, a^{2}}, \frac {8 \, {\left (9 \, a^{2} b - 8 \, b^{3}\right )}}{27 \, a^{3}}, \frac {3 \, a \cos \left (d x + c\right ) + 3 i \, a \sin \left (d x + c\right ) + 2 \, b}{3 \, a}\right ) + \sqrt {2} {\left (3 i \, {\left (A + 3 \, C\right )} a^{2} - 6 i \, B a b + 4 i \, A b^{2}\right )} \sqrt {a} {\rm weierstrassPInverse}\left (-\frac {4 \, {\left (3 \, a^{2} - 4 \, b^{2}\right )}}{3 \, a^{2}}, \frac {8 \, {\left (9 \, a^{2} b - 8 \, b^{3}\right )}}{27 \, a^{3}}, \frac {3 \, a \cos \left (d x + c\right ) - 3 i \, a \sin \left (d x + c\right ) + 2 \, b}{3 \, a}\right ) - 3 \, \sqrt {2} {\left (-3 i \, B a^{2} + 2 i \, A a b\right )} \sqrt {a} {\rm weierstrassZeta}\left (-\frac {4 \, {\left (3 \, a^{2} - 4 \, b^{2}\right )}}{3 \, a^{2}}, \frac {8 \, {\left (9 \, a^{2} b - 8 \, b^{3}\right )}}{27 \, a^{3}}, {\rm weierstrassPInverse}\left (-\frac {4 \, {\left (3 \, a^{2} - 4 \, b^{2}\right )}}{3 \, a^{2}}, \frac {8 \, {\left (9 \, a^{2} b - 8 \, b^{3}\right )}}{27 \, a^{3}}, \frac {3 \, a \cos \left (d x + c\right ) + 3 i \, a \sin \left (d x + c\right ) + 2 \, b}{3 \, a}\right )\right ) - 3 \, \sqrt {2} {\left (3 i \, B a^{2} - 2 i \, A a b\right )} \sqrt {a} {\rm weierstrassZeta}\left (-\frac {4 \, {\left (3 \, a^{2} - 4 \, b^{2}\right )}}{3 \, a^{2}}, \frac {8 \, {\left (9 \, a^{2} b - 8 \, b^{3}\right )}}{27 \, a^{3}}, {\rm weierstrassPInverse}\left (-\frac {4 \, {\left (3 \, a^{2} - 4 \, b^{2}\right )}}{3 \, a^{2}}, \frac {8 \, {\left (9 \, a^{2} b - 8 \, b^{3}\right )}}{27 \, a^{3}}, \frac {3 \, a \cos \left (d x + c\right ) - 3 i \, a \sin \left (d x + c\right ) + 2 \, b}{3 \, a}\right )\right )}{9 \, a^{3} d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {A + B \sec {\left (c + d x \right )} + C \sec ^{2}{\left (c + d x \right )}}{\sqrt {a + b \sec {\left (c + d x \right )}} \sec ^{\frac {3}{2}}{\left (c + d x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {A+\frac {B}{\cos \left (c+d\,x\right )}+\frac {C}{{\cos \left (c+d\,x\right )}^2}}{\sqrt {a+\frac {b}{\cos \left (c+d\,x\right )}}\,{\left (\frac {1}{\cos \left (c+d\,x\right )}\right )}^{3/2}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________